package cliente;

import java.util.Properties;

import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;

import fabrica.service.IFabricaService;

public class PruebasFabrica {
	

	public static void main(String args[]) throws NamingException, InterruptedException{
		
		//parametros
		Properties jndiProps = new Properties();
		jndiProps.put(Context.INITIAL_CONTEXT_FACTORY, "org.jboss.naming.remote.client.InitialContextFactory");
		jndiProps.put(Context.PROVIDER_URL,"remote://127.0.0.1:4447");

		 // This is an important property to set if you want to do EJB invocations via the remote-naming project
		 jndiProps.put("jboss.naming.client.ejb.context", true);
		 
		 // create a context passing these properties
		 Context context = new InitialContext(jndiProps);
		 
		 // lookup the bean
		 IFabricaService iFabrica =(IFabricaService)context.lookup("TPO_IA_Fabrica_EAR/TPO_IA_Fabrica/FabricaService!fabrica.service.IFabricaService");
		 
		 
		 //***** PRUEBAS LB *****//
		 try{
			 iFabrica.pruebaJMS("<DATOS ORDEN DE FABRICACION>");
		 }
		 catch(Exception e){
			 System.out.println(e.getMessage());
		 }
	}
	
}
